package com.znyj.cloud.chain.util;

/**
 * Created by gaoliwei on 15-1-15.
 */
public class StringUtil {

    public static int parseInteger(String str, int defaultValue) {
        try {
            return Integer.valueOf(str.trim());
        } catch (Exception e) {
            return defaultValue;
        }
    }

    public static int parseInteger(String str) {
        return parseInteger(str, 0);
    }

}
